#

| Chapter 24 Other Ways to Get Disk Space |

## 24.14 Don't Use strip Carelessly

One nice way to save space in your filesystem is by running strip (24.13) on directly-executable (binary) files. You'll probably think of running it recursively with find (17.2). Be careful. On some operating systems, using strip on a setuid file (1.23) will strip the setuid bit; the program won't be setuid anymore. It's best to tell find to skip setuid and setgid files. For instance, the command below finds all world-executable files (17.15) that are not setuid or setgid (17.16):

>     % find . -type f -perm -0001 ! -perm -4000 ! -perm -2000 ...

Other files that shouldn't be stripped include the UNIX kernel (like /vmunix) and files that programmers need to debug.

- JP

24.13 Save Space in Executable Files with strip |  | 24.15 Trimming a Directory